<template>
    <dev class="page-container">
      <el-table :data="goodsList">
        
        <el-table-column label="ID" prop="id"></el-table-column>
        <el-table-column label="商品图" prop="titleImage">
          <template #default="scope">
            <el-image  :src="imageBase + scope.row.titleImage" style="width: 30px; height: 30px;"></el-image>
          </template>
        </el-table-column>
        <el-table-column label="商品名称" prop="goodsName"></el-table-column>
        <el-table-column label="商品售价" prop="price"></el-table-column>
        <el-table-column label="销量" prop="number"></el-table-column>
        <el-table-column label="库存" prop="stock"></el-table-column>
        <el-table-column label="排序" prop="sort"></el-table-column>
        <el-table-column label="添加时间" prop="createTime"></el-table-column>
        
        <el-table-column fixed="right" label="状态" prop="createTime">
          <template #default="scope">
            <el-switch
              v-model="scope.row.status"
              class="ml-2"
              inline-prompt
              active-text="上架"
              inactive-text="下架"
              active-value="1"
              inactive-value="0"
            />
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" prop="createTime">
          <template #default="scope">
            <el-button link type="primary" size="small" >详情</el-button>
            <el-button link type="primary" size="small" >编辑</el-button>
            <el-button link type="primary" size="small" >加入回收站</el-button>
          </template> 
        </el-table-column>
      </el-table>
    </dev>
</template>

<script setup lang="ts" name="goodsList">
import { defineAsyncComponent, reactive, ref, onMounted } from 'vue';

defineProps({
  goodsList: {
    default: [],
    type: Array,
  }
});
const imageBase = 'http://localhost:8080/profile/'
const activeName = ref('sell')
const queryParams=ref({
    classify:null,
    goodsName:null
})
</script>
<style scoped lang="scss">

</style>